<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
<meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
<title>确认订单</title>
<link rel="stylesheet" type="text/css" href="../../css/aui-flex.css" />
<link rel="stylesheet" type="text/css" href="../../css/aui.css" />
<link rel="stylesheet" type="text/css" href="../../css/common.css" />
<style>
body{
	background: #f5f5f5;
}
.addrSec {
	padding: 0.75rem 1rem;
	margin-bottom: 0.4rem;
}
.address {
	padding-left: 1rem;
	padding-right: 1rem;
	min-height: 3rem;
}
.con{
	position: relative;
	color: #010101;
	font-size: 0.7rem;
}
.con:before {
	content: "";
	position: absolute;
	left: -1rem;
	top: 0.1rem;
	width: 0.68rem;
	height: 0.75rem;
	background: url(../../image/common/32.png) no-repeat;
	background-size: auto 0.75rem;
}
.addr {
	position: relative;
	margin-top: 0.5rem;
	color: #373336;
	font-size: 0.65rem;
	line-height: 20px;
}
.addr:before {
	content: "";
	position: absolute;
	left: -1rem;
	top: 0.1rem;
	width: 0.65rem;
	height: 0.75rem;
	background: url(../../image/common/33.png) no-repeat;
	background-size: auto 0.75rem;
}
.address .def {
	position: relative;
	top: -0.1rem;
	margin-left: 0.5rem;
	display: inline-block;
	font-size: 0.5rem;
	height: 0.8rem;
	line-height: 0.8rem;
	border-radius: 0.2rem;
	text-align: center;
	width: 1.45rem;
	vertical-align: middle;
}
.shop .item {
	padding: 0.9rem 1rem 0;
}
.shop .media {
	width: 3.6rem;
}
.textBox {
	min-height: 4.5rem;
	padding-left: 0.5rem;
}
.comBox{
	padding: 1.2rem 1rem 0;
}
.comBox .comMode{
	min-height: 2.1rem;
	line-height: 2.1rem;
	border-top: 1px solid #eee;
}
.comU{
	padding-top: 0.7rem;
	padding-bottom: 1rem;
}

.pay-list{
  padding: 0 .9rem;
  background-color: white;
  margin: .5rem 0;
}
.pay-list li{
  height: 2.5rem;
  /*padding: 0 0.75rem;*/
  font-size:0.7rem;
  color:#444444;
}
.pay-list li .imgBox{
  border-radius: 50%;
  margin-right: 0.3rem;
}
.pay-list li img{
  height: 1rem;
}
</style>
</head>
<body>
<div class="aui-content">
	<!-- <div class="addrSec bg-white" tapmode onclick="selectAddr();">
		<div class="blankAddr right-arrow aui-py-5">
			请填写收货人联系方式
		</div>
	</div>
	<script type="text/x-dot-template" id="addr_tpl">
	<div class="address aui-flex-row aui-flex-middle right-arrow">
		<div class="aui-flex-col aui-flex-between">
			<div class="con">{{= it.receive_name || ''}}</div>
			<div class="phone">{{= it.receive_mobile || ''}}</div>
		</div>
		<div class="addr">{{= it.receive_address || ''}}</div>
	</div>
	</script> -->
	<div id="data_html"></div>
	<!-- <div class="shop bg-white">
		<div class="item">
			<div class=" aui-flex-col aui-flex-middle">
				<div class="media"><img src="../../image/demo/03.png" alt=""></div>
				<div class="flex-auto aui-padded-l-10 aui-padded-r-15">
					<div class="aui-font-size-12 color-000 aui-ellipsis-2">心相印卷纸 心柔3层140g*27粒纸巾整箱 新老包装随机...</div>
					<div class="color-666 aui-font-size-12 aui-ellipsis">灰色</div>
					<div class="aui-flex-col aui-flex-between aui-flex-middle">
						<div class="color-red">¥dd</div>
						<div class="color-666">×1</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="comBox bg-white">
		<div class="comMode aui-flex-col aui-flex-between aui-flex-middle aui-border-b">
			<div>配送方式</div>
			<div>快递免邮</div>
		</div>
		<div class="comU aui-flex-col aui-flex-right aui-flex-middle color-000 aui-font-size-12">
			<div>共2件商品</div>
			<div class="aui-padded-l-5">小计：<span class="text-bold">¥dd</span></div>
		</div>
	</div> -->
</div>
<script type="text/x-dot-template" id="data_tpl">
<div class="shop bg-white">
<div class="addrSec bg-white" tapmode onclick="">
	<div class="address aui-flex-row aui-flex-middle">
		<div class="aui-flex-col aui-flex-between">
			<div class="con">{{=it.order_rcv_name}}</div>
			<div></div>
			<div class="aui-text-right">{{=it.order_rcv_mobile}}</div>
		</div>
		<div class="addr">{{=it.order_rcv_address}}</div>
	</div>
</div>
	<div class="item">
		<div class="aui-flex-col aui-flex-middle">
			<div class="media"><img src="{{= it.goods_cover || '' }}" alt=""></div>
			<div class="flex-auto aui-padded-l-10 aui-padded-r-15">
				<div class="aui-font-size-12 color-000 aui-ellipsis-2" id="goods_name">{{= it.goods_name || '' }}</div>
				<div class="color-666 aui-font-size-12 aui-ellipsis">{{= it.goods_spec_names || '' }}</div>
				<div class="aui-flex-col aui-flex-between aui-flex-middle">
					<div><div class="color-red">{{= it.goods_unit_price || '' }}</div>积分</div>
					<div class="color-666" id="goods_count">×{{= it.order_goods_count || '1' }}</div>
				</div>
			</div>
		</div>
	</div>
</div>
<div class="comBox bg-white">
	<div class="comMode aui-flex-col aui-flex-between aui-flex-middle aui-border-b">
		<div>配送方式</div>
		<div>快递免邮</div>
	</div>
	<div class="comU aui-flex-col aui-flex-right aui-flex-middle color-000 aui-font-size-12">
		<div>共{{= it.order_goods_count || '1'}}件商品</div>
		<div class="aui-padded-l-5">小计：<span class="text-bold">{{= it.order_price}}</span>积分</div>
	</div>
</div>
</script>

</body>
<script type="text/javascript" src="../../script/import.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript">
var isSave = false;
var ORDER_ID;
var userid;
apiready = function() {
	ORDER_ID = api.pageParam.orderId;
	getOrderDetail()
	userid= getUserId();
};
var infos = {
	userid: userid,
	goodsDatas: []
};
function getOrderDetail(){
	ORDER_ID = api.pageParam.orderId;
	console.log(ORDER_ID)
		api.ajax({
				url: BASE_URL + 'App/Mall/orderDetail',
				method: 'post',
				data: {
						values: {
							id: ORDER_ID,
							userid: getUserId()
						}
				}
		},function(ret, err){
				if (ret && ret.code == 1) {
					data = {

					}
					data.goods_id = ret.data.order_goods_id;
					data.goods_name = ret.data.goods_name;
					data.goods_cover = ret.data.goods_cover;
					data.goods_type = ret.data.order_goods_type;
					data.goods_spec_ids = ret.data.order_goods_spec_ids;
					data.goods_spec_names = ret.data.order_goods_spec_names;
					data.goods_attr_ids = ret.data.order_goods_attr_ids;
					data.goods_attr_names = ret.data.order_goods_attr_names;
					data.goods_unit_price = ret.data.order_price;
					data.price_id = ret.data.order_price_id;
					data.goods_count = ret.data.order_goods_count;
					data.goods_pay_price = ret.data.order_pay_price;
					infos.receive_name = ret.data.order_rcv_name;
					infos.receive_mobile = ret.data.order_rcv_mobile;
					infos.receive_province = ret.data.order_rcv_province;
					infos.receive_city = ret.data.order_rcv_city;
					infos.receive_district = ret.data.order_rcv_district;
					infos.receive_address = ret.data.order_rcv_address;
					infos.totalUcoin = ret.data.order_pay_price;
					infos.goodsDatas.push(data)
					var tpl = $$('#data_tpl').html();
					var tempFn = doT.template(tpl);
					$$('#data_html').html(tempFn(ret.data));
				} else {
					// $$('.notData').removeClass('aui-hide');
				}
		});
}

//选择地址
function selectAddr(){
	api.openWin({
		name: 'address_win',
		url: '../mine/address_win.html',
		slidBackEnabled: false,
		pageParam: {
			wname: api.winName,
			fname: api.frameName
		}
	});
}
function save(){
	if(isSave){
		return;
	}
	isSave = true;
	showProgress(true);
	api.ajax({
	    url: BASE_URL + 'App/Mall/orderAdd',
	    method: 'post',
	    data: {
	        values: infos
	    }
	},function(ret, err){
		console.log(JSON.stringify(ret))
		isSave = false;
		hideProgress();
	    if (ret && ret.code == 1) {
			api.sendEvent({
				name: 'addOrderSuccessEvent'
			});
			orderSuccess();
		}else{
			toast('系统异常');
		}
	});
}
function orderSuccess(){
	api.sendEvent({
		name: 'orderPaySuccessEvent'
	});
	api.openWin({
		name: 'mask_exchange',
		url: 'mask_exchange.html',
		animation: {
			type: 'fade',
			duration: 200
		},
		bounces: false,
		bgColor: '#FFF',
		slidBackEnabled: false,
		pageParam: {
			totalUcion: infos.totalUcion,
			name: $$('#goods_name').text(),
			count: $$('#goods_count').text()
		}
	});
}
</script>
</html>
